//
//  SearchViewController.m
//  时尚男士
//
//  Created by 张家为 on 15/6/16.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "SearchViewController.h"

#import "mySearchViewController.h"

@interface SearchViewController ()<UITextFieldDelegate>
@property (nonatomic, retain)UITextField *searchField ;
@end

@implementation SearchViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.hud hide:YES];
    
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField{
    [textField resignFirstResponder];
    NSString *str = [NSString stringWithFormat:@"http://rm.app.isee.com.cn/json_rm.php?action=list&ver=10&page=0&category=nanren&category2=%%2F%@&pageSize=24&appCookie=channel_AppStore%%20version_6.9%%20oid_9342E03B-D33F-4832-B1A0-037604E0A97E%%20package_com.aslibra.rm.nanren%%20platform_iphone%%20ver_7.1.2%%20jb_1%%20t1_1434418628%20md5_01%%20t_1432890077&width=320&keyword=",textField.text];
    
  
    [self connectionStr:str];
    mySearchViewController *mysearch = [[mySearchViewController alloc] init];
    [self.navigationController pushViewController:mysearch animated:NO];
    mysearch.str = str;
    mysearch.textStr = textField.text;
    [mysearch release];

    return YES;
}
-(void)viewWillDisappear:(BOOL)animated{
    self.searchField.hidden = YES;
}
- (void)viewWillAppear:(BOOL)animated{
    self.searchField = [[UITextField alloc] initWithFrame:CGRectMake(90, 5, 200, 30)];
    self.searchField.placeholder = @"搜索你感兴趣的内容";
    self.searchField.borderStyle = UITextFieldViewModeAlways;
    self.searchField.delegate = self;
    self.searchField.keyboardAppearance = UIKeyboardAppearanceDark;
    self.searchField.returnKeyType = UIReturnKeySend;
    [self.navigationController.navigationBar addSubview: self.searchField];
    // Do any additional setup after loading the view.
    [self.searchField release];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
